<div>
    <h2 id="page-heading">
        <span jhiTranslate="husenApp.shopInfo.home.title">Shop Infos</span>
        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-shop-info" [routerLink]="['/shop-info/new']">
            <fa-icon [icon]="'plus'"></fa-icon>
            <span class="hidden-sm-down"  jhiTranslate="husenApp.shopInfo.home.createLabel">
            Create new Shop Info
            </span>
        </button>
    </h2>
    <jhi-alert></jhi-alert>
    <div class="row">
        <div class="col-sm-12">
            <form name="searchForm" class="form-inline">
                <div class="input-group w-100 mt-3">
                    <input type="text" class="form-control" [(ngModel)]="currentSearch" id="currentSearch" name="currentSearch" placeholder="{{ 'husenApp.shopInfo.home.search' | translate }}">
                    <button class="input-group-append btn btn-info" (click)="search(currentSearch)">
                        <fa-icon [icon]="'search'"></fa-icon>
                    </button>
                    <button class="input-group-append btn btn-danger" (click)="clear()" *ngIf="currentSearch">
                        <fa-icon [icon]="'trash-alt'"></fa-icon>
                    </button>
                </div>
            </form>
        </div>
    </div>
    <br/>
    <div class="table-responsive" *ngIf="shopInfos">
        <table class="table table-striped">
            <thead>
            <tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="transition.bind(this)">
            <th jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="sname"><span jhiTranslate="husenApp.shopInfo.sname">Sname</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="gname"><span jhiTranslate="husenApp.shopInfo.gname">Gname</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="gadds"><span jhiTranslate="husenApp.shopInfo.gadds">Gadds</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="homeType"><span jhiTranslate="husenApp.shopInfo.homeType">Home Type</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="carType"><span jhiTranslate="husenApp.shopInfo.carType">Car Type</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="orderType"><span jhiTranslate="husenApp.shopInfo.orderType">Order Type</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="vipType"><span jhiTranslate="husenApp.shopInfo.vipType">Vip Type</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="vipSale"><span jhiTranslate="husenApp.shopInfo.vipSale">Vip Sale</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="spicImg"><span jhiTranslate="husenApp.shopInfo.spicImg">Spic Img</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="gpicImg"><span jhiTranslate="husenApp.shopInfo.gpicImg">Gpic Img</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="searchTag"><span jhiTranslate="husenApp.shopInfo.searchTag">Search Tag</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="carText"><span jhiTranslate="husenApp.shopInfo.carText">Car Text</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="times"><span jhiTranslate="husenApp.shopInfo.times">Times</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="phone"><span jhiTranslate="husenApp.shopInfo.phone">Phone</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="coupons"><span jhiTranslate="husenApp.shopInfo.coupons">Coupons</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="coupons1Id"><span jhiTranslate="husenApp.shopInfo.coupons1">Coupons 1</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th></th>
            </tr>
            </thead>
            <tbody>
            <tr *ngFor="let shopInfo of shopInfos ;trackBy: trackId">
                <td><a [routerLink]="['/shop-info', shopInfo.id, 'view' ]">{{shopInfo.id}}</a></td>
                <td>{{shopInfo.sname}}</td>
                <td>{{shopInfo.gname}}</td>
                <td>{{shopInfo.gadds}}</td>
                <td>{{shopInfo.homeType}}</td>
                <td>{{shopInfo.carType}}</td>
                <td>{{shopInfo.orderType}}</td>
                <td>{{shopInfo.vipType}}</td>
                <td>{{shopInfo.vipSale}}</td>
                <td>
                    <a *ngIf="shopInfo.spicImg" (click)="openFile(shopInfo.spicImgContentType, shopInfo.spicImg)">
                        <img [src]="shopInfo.spic" style="max-height: 30px;" alt="shopInfo image"/>
                    </a>
                </td>
                <td>
                    <a *ngIf="shopInfo.gpicImg" (click)="openFile(shopInfo.gpicImgContentType, shopInfo.gpicImg)">
                        <img [src]="shopInfo.gpic" style="max-height: 30px;" alt="shopInfo image"/>
                    </a>
                </td>
                <td>{{shopInfo.searchTag}}</td>
                <td>{{shopInfo.carText}}</td>
                <td>{{shopInfo.times}}</td>
                <td>{{shopInfo.phone}}</td>
                <td>{{shopInfo.coupons}}</td>
                <td>
                    <div *ngIf="shopInfo.coupons1Id">
                        <a [routerLink]="['../coupons', shopInfo.coupons1Id , 'view' ]" >{{shopInfo.coupons1Id}}</a>
                    </div>
                </td>
                <td class="text-right">
                    <div class="btn-group flex-btn-group-container">
                        <button type="submit"
                                [routerLink]="['/shop-info', shopInfo.id, 'view' ]"
                                class="btn btn-info btn-sm">
                            <fa-icon [icon]="'eye'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/shop-info', shopInfo.id, 'edit']"
                                class="btn btn-primary btn-sm">
                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/', { outlets: { popup: 'shop-info/'+ shopInfo.id + '/delete'} }]"
                                replaceUrl="true"
                                queryParamsHandling="merge"
                                class="btn btn-danger btn-sm">
                            <fa-icon [icon]="'times'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
                        </button>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div *ngIf="shopInfos && shopInfos.length">
        <div class="row justify-content-center">
            <jhi-item-count [page]="page" [total]="queryCount" [maxSize]="5" [itemsPerPage]="itemsPerPage"></jhi-item-count>
        </div>
        <div class="row justify-content-center">
            <ngb-pagination [collectionSize]="totalItems" [(page)]="page" [pageSize]="itemsPerPage" [maxSize]="5" [rotate]="true" [boundaryLinks]="true" (pageChange)="loadPage(page)"></ngb-pagination>
        </div>
    </div>
</div>
